package com.bw.lib_storage.db.dao

import androidx.room.Dao
import androidx.room.Delete
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query
import androidx.room.Update
import com.bw.lib_storage.db.entity.History
import com.bw.lib_storage.db.entity.Student

@Dao
interface StudentDao {

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    fun insert(student: Student)

    @Insert
    fun insertAll(vararg student:Student)


    @Delete
    fun deleteStudent(student: Student)

    @Update
    fun updateStudent(student: Student)

    @Query("SELECT * FROM student")
    fun getAllStudent():List<Student>

    @Query("SELECT * FROM student WHERE name LIKE '%'+:name+'%'")
    fun getStudentByTitle(name:String):List<Student>
}